using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace Yunwei.Domain.Models.Mapping
{
    public class FoodIngredientMap : EntityTypeConfiguration<FoodIngredient>
    {
        public FoodIngredientMap()
        {
            // Primary Key
            this.HasKey(t => t.Id);

            this.Property(t => t.Food_Id).IsRequired();
            this.Property(t => t.Ingredient_Id).IsRequired();

            // Properties
            // Table & Column Mappings
            this.ToTable("FoodIngredient");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.Food_Id).HasColumnName("Food_Id");
            this.Property(t => t.Ingredient_Id).HasColumnName("Ingredient_Id");
            this.Property(t => t.Amount).HasColumnName("Amount");
        }
    }
}
